package com.yanqu.road.entity.activity.tongbing.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_c_tongbing_data")
public class CrossTongBingData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "活动分组ID")
    private int groupId;

    @FieldTypeAnnotation(desc = "锁榜单")
    private boolean lockUnion;

    @FieldTypeAnnotation(desc = "城主ID")
    private long process2WinUserId;

    @FieldTypeAnnotation(desc = "城池事件刷新时间")
    private long refreshCityEventTime;
    @FieldTypeAnnotation(desc = "城池事件生效时间")
    private long applyCityEventTime;
    @FieldTypeAnnotation(desc = "城池未触发事件")
    private Map<Integer, CrossTongBingCityEvent> cityEventMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "阵营BUFF")
    private Map<Integer, List<CrossTongBingCampBuff>> campBuffMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "npc事件时间")
    private long npcEventAddTime; // 添加事件事件（每过一定时间全员加一次事件）这东西要入库

    @FieldTypeAnnotation(desc = "所有城池数据")
    private Map<Integer, CrossTongBingCity> cityMap = new ConcurrentHashMap<>(); // 所有城池：阶段、城池ID、城池数据

    @FieldTypeAnnotation(desc = "自动发辎重奖励")
    private int autoSendCollect;

    // ===============================================

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public boolean isLockUnion() {
        return lockUnion;
    }

    public void setLockUnion(boolean lockUnion) {
        if (this.lockUnion != lockUnion) {
            this.lockUnion = lockUnion;
            setOp(DataStatus.Update);
        }
    }

    public long getProcess2WinUserId() {
        return process2WinUserId;
    }

    public void setProcess2WinUserId(long process2WinUserId) {
        if (this.process2WinUserId != process2WinUserId) {
            this.process2WinUserId = process2WinUserId;
            setOp(DataStatus.Update);
        }
    }

    public long getRefreshCityEventTime() {
        return refreshCityEventTime;
    }

    public void setRefreshCityEventTime(long refreshCityEventTime) {
        if (this.refreshCityEventTime != refreshCityEventTime) {
            this.refreshCityEventTime = refreshCityEventTime;
            setOp(DataStatus.Update);
        }
    }

    public long getApplyCityEventTime() {
        return applyCityEventTime;
    }

    public void setApplyCityEventTime(long applyCityEventTime) {
        if (this.applyCityEventTime != applyCityEventTime) {
            this.applyCityEventTime = applyCityEventTime;
            setOp(DataStatus.Update);
        }
    }

    public Map<Integer, CrossTongBingCityEvent> getCityEventMap() {
        return cityEventMap;
    }

    public void setCityEventMap(Map<Integer, CrossTongBingCityEvent> cityEventMap) {
        if (null == cityEventMap) {
            return;
        }
        this.cityEventMap = cityEventMap;
        setOp(DataStatus.Update);
    }

    public long getNpcEventAddTime() {
        return npcEventAddTime;
    }

    public void setNpcEventAddTime(long npcEventAddTime) {
        if (this.npcEventAddTime != npcEventAddTime) {
            this.npcEventAddTime = npcEventAddTime;
            setOp(DataStatus.Update);
        }
    }

    public Map<Integer, CrossTongBingCity> getCityMap() {
        return cityMap;
    }

    public void setCityMap(Map<Integer, CrossTongBingCity> cityMap) {
        if (null == cityMap) {
            return;
        }
        this.cityMap = cityMap;
        setOp(DataStatus.Update);
    }

    public Map<Integer, List<CrossTongBingCampBuff>> getCampBuffMap() {
        return campBuffMap;
    }

    public void setCampBuffMap(Map<Integer, List<CrossTongBingCampBuff>> campBuffMap) {
        if (campBuffMap == null) {
            return;
        }
        this.campBuffMap = campBuffMap;
        setUpdateOption();
    }

    public int getAutoSendCollect() {
        return autoSendCollect;
    }

    public void setAutoSendCollect(int autoSendCollect) {
        if (this.autoSendCollect != autoSendCollect) {
            this.autoSendCollect = autoSendCollect;
            setUpdateOption();
        }
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        if (this.groupId != groupId) {
            this.groupId = groupId;
            setUpdateOption();
        }
    }

}
